package com.test;

import com.test.utils.BaseUtils;
import org.apache.log4j.Logger;

import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Map;

/**
 * Created by ZZF on 2017/6/28.
 */
public class test2 {

    private static Logger logger = Logger.getLogger(test2.class);

    public static void main(String[] args) {
//        SimpleDateFormat df1 = new SimpleDateFormat("EEEE");//设置日期格式
//        System.out.println(df1.format(new Date()));

//        Integer integer = Integer.valueOf(format.substring(5, 7));
//
//        System.out.println(integer);

        Map<String, String> StringMap = BaseUtils.inputConfig();

        Date newDate = new Date();

        String d1 = "2017-7-18 11:00:00";

        String workTimeStr = StringMap.get("WorkTime");

        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");

        Date planTime = null;
        try {
            planTime = sdf.parse(d1);
        } catch (ParseException e) {
            e.printStackTrace();
        }

        System.out.println(newDate.getTime());
        System.out.println(planTime.getTime());

        double workTime=1;
        System.out.println(workTime);

         workTime = (double)(newDate.getTime() - planTime.getTime()) / (1000 * 60 * 60 );

        Double aDouble = BaseUtils.formatDouble(workTime);

        System.out.println(aDouble);

        BigDecimal timeSub=new BigDecimal(workTime);


        String xx="";



    }
}
